package 依赖倒置原则;

/**
 * @ClassNameXiaoZhou
 * @Description
 * @Author
 * @Date2021/11/13 16:34
 **/
public class Student {
    /**
     * 依赖注入
     * @param course
     */
   /*public void study(Course course){
       course.study();
   }*/

    /**
     * 课程属性
     */
    private Course course;
    public void study(){
        course.study();
    }
    /**
     * set注入
     */
   public void setCourse(Course course) {
        this.course = course;
    }

    /**
     * 构造注入
     * @param course
     */
    public Student(Course course) {
        this.course = course;
    }



}
